<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <!-- <input type="text" name="" value="电脑"> -->
    <input type="checkbox" name="" id="">
    <button>点击</button>
    <script>
        //获取元素
        //const uname = document.querySelector('input')
        //获取值 获取表单里面的值 用的 表单.value
        //console.log(uname.value);//得到表单里面的value值
        //console.log(uname.innerHTML);//innerHTML 得不到表单里面的值
        //uname.value = '买电脑'//更改表单的value值
        //console.log(uname.type);//得到表单属性type="text"
        // uname.type = 'password'//更改type属性值

        //获取元素
        const ipt = document.querySelector('input')
        // console.log(ipt.checked);//得到input属性checked值默认为false
        ipt.addEventListener('click', function () {
            btn.disabled = ipt.checked//false为显示可使用 true为禁用 
        })
        const btn = document.querySelector("button")
    </script>
</body>

</html>